{% extends "house/base.html" %}
{% block title %}Оплата консьержа{% endblock %}
{% block content_title %}{% endblock %}


{% block sub_menu %}
<li><a href="{% url prev_month %}">Предыдущий месяц</a></li>
<li><a href="{% url current_month %}">Текущий месяц</a></li>
<li><a href="{% url next_month %}">Следующий месяц</a></li>
<li><a href="{% url debtor %}">Неплательщики</a></li>
{% endblock %} 

{% block mainmenuitem_1 %}class="mainMenuSelectedItem"{% endblock %}

{% block main %}

<h2>{{processed_month_verbose}} {{processed_year}} г.</h2>

{% include "house/date_select.html" %}

<div class="floats">
<table>
  <tr>
    <th width="4%">Этаж</th>
 
    <th width="4%">Кв. №</th>
    <th width="5%">Сумма</th>
    <th width="1%"></th>
    <th width="14%">Оплата</th>   

    <th width="4%">Кв. №</th>
    <th width="5%">Сумма</th>
    <th width="1%"></th>
    <th width="14%">Оплата</th>    
    
    <th width="4%">Кв. №</th>
    <th width="5%">Сумма</th>
    <th width="1%"></th>
    <th width="14%">Оплата</th>    

    <th width="4%">Кв. №</th>
    <th width="5%">Сумма</th>
    <th width="1%"></th>
    <th width="14%">Оплата</th>     
  </tr>
  <tr>
  {% for apartment in apartment_list %}

  {% if forloop.counter0|divisibleby:"4" %}
    </tr><tr><td>{% cycle '2' '3' '4' '5' '6' '7' '8' '9' '10' '11' '12' '13' '14' '15' '16' '17' '18' '19' '20' '21' '22' '23'%}</td>
  {% endif %}
    <td class="app_column">
    <a href="{% url apartment_property apartment.id %}"  title="Редактирование данных квартиры"
    <b>{{ apartment.number }}</b>
    </a>
    </td>
    <td><nobr>
      {% if apartment.summ != 0 %}
        {{ apartment.summ }} р.
      {% endif %}
      {% if not apartment.cashed and apartment.payment_summ %}
        {% if apartment.summ != 0 %}<font color="brown"> / {% endif %}
            {{ apartment.payment_summ }} р.
        {% if apartment.summ != 0 %}</font>{% endif %}
      {% endif %}
      </nobr>
    </td>
    <td>
      {% if apartment.summ != 0 %}
        {% if not apartment.cashed %}
          <img src="{{ STATIC_URL }}house/img/house-into.gif" width="14" height="14" alt="по умолчанию" title="Ввести сумму по умолчанию"
          OnClick="setCash('{{ apartment.summ }}', 'form_id_{{ apartment.id }}');"
          style="cursor:pointer; cursor: hand;">
        {% endif %}
      {% endif %} 
    </td>
    <td>
    {% if apartment.summ == 0 %}
      <Font color="red">Не платят</Font>
    {% else %}
      {% if not apartment.cashed %}
      <nobr>
      <form name="form_name_{{ apartment.id }}" method="post" action="." 
        onsubmit="return checkForm(this, 'Зачислить в '+'{{ apartment.number }} квартиру ');" id="form_id_{{ apartment.id }}">
        <input name="cash" type="text" size="5"/>
        <input name="id" type="hidden" value="{{ apartment.id }}"/>
        {% comment %}<input type="submit" value="Зачислить"/>{% endcomment %}
        <input type="image" src="{{ STATIC_URL }}house/img/house-ok.gif" title="Зачислить"/>
      </form>
      </nobr>
      {% else %}
        <nobr><Font color="green">{{ apartment.cashed_date|date:"d.m.Y" }}</Font></nobr>
      {% endif %}
    {% endif %} 
    </td>
  {% endfor %} 
  </tr>
</table>
   
</div>

{% endblock %}
